package com.tongtailian.www.stir.activity;

import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.View;
import android.view.WindowManager;
import android.widget.TextView;

import com.tongtailian.www.stir.R;
import com.tongtailian.www.stir.base.BaseActivity;


/**
 * Created by moonface on 16-6-13.
 * com.eagle.jiayou.jiayou.view.activity
 */
public class SplashActivity extends BaseActivity implements View.OnClickListener {
    private TextView tvMore;
    private TextView tvInput;

    @Override
    public int setLayoutId() {
        // 隐藏状态栏
        getWindow().addFlags(WindowManager.LayoutParams.FLAG_FULLSCREEN);
        return R.layout.activity_splash;
    }

    @Override
    public void initVariables() {
        //CrashReport.initCrashReport(getApplicationContext(), "c2f5a9e466", false);
    }

    @Override
    public void initViews(Bundle savedInstanceState) {

        tvMore = findViewById(R.id.tv_more);
        tvInput = findViewById(R.id.tv_input);
        tvMore.setOnClickListener(this);
        tvInput.setOnClickListener(this);
    }
    @Override
    public void doBusiness() {
//        jumpToNext();
    }
    private void jumpToNext() {
        new Handler().postDelayed(new Runnable() {
            @Override
            public void run() {
                startActivity(new Intent(SplashActivity.this, MainActivity.class));
                finish();
            }
        }, 1000);
    }

    @Override
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.tv_more:
//                ToastUtils.showCenter("更多产品");
                startActivity(new Intent(SplashActivity.this, ProductList.class));
                break;
            case R.id.tv_input:
                startActivity(new Intent(SplashActivity.this, MainActivity.class));
                finish();
                break;
        }
    }
}
